%read frequency in gates file from flowjo tables
%Array: [row,col,timepoint,gate]
%flow_path = '../All_Lim_FACS_tvs/120512_freq_gates_96_from_111912.tab';
flow_path = '../All_Lim_FACS_tvs/121012_freq_gates_96_all.tab';

[data,titles] = read_flowjo_table(flow_path);

cluster_max = max(max(max(data(:,:,:,2))));

%% Plotting
defaultPlot()
i=1;
while ~all(all(all((isnan(squeeze(data(:,:,i,:)))))))
    clusters = squeeze(data(:,:,i,2));
    %Flip output to match Hyun's
    clusters = flipdim(flipdim(clusters,1),2);
    %Print matrix for Hyun's input
    titles{i}
    mat2str(clusters)
    if i>1 
        figure
        defaultPlot()

    end
    %contourf(plate_x,plate_y,clusters)
    contourf(clusters)
    xlabel('Dox')
    ylabel('OD Ratio')
    title(titles{i}(2:end));
    caxis([0 cluster_max])
    colorbar()
    i = i+1;
end